﻿<%@ Page Language="C#" MasterPageFile="~/GestorEventos.Master" AutoEventWireup="true" CodeBehind="showEvento.aspx.cs" Inherits="GestorEventos.showEvento" Title="Untitled Page" %>
<%@ Import Namespace="Business" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 289px;
        }
        .style2
        {
            width: 187px;
        }
        .style3
        {
            width: 3px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="UserArea" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Main" runat="server">
            <asp:Label Font-Size="Large" ID="Label2Nome" runat="server" Text="" 
            style="color: #FF9900; font-size: x-large"> </asp:Label>
            <hr />
            <br />
            <br />
            
           
    <table>  
        <tr>
            <td>
                <asp:Label ID="LabelInfoEvento"  Font-Size="Medium" runat="server" Text="info"></asp:Label>
            </td>
            <td>
                
            </td>
        </tr>
        
        <tr>
            <td colspan="2">
                <hr />
            </td>
        </tr>
        <tr>  
    <tr>
        <td>
            <asp:Label ID="LabelDataInicio" runat="server" Text="DataInicio"></asp:Label>
        </td>
        
        <td>
            <asp:Label ID="Label2DataInicio" runat="server" Text=""></asp:Label>
        </td>
    </tr>
    
    <tr>
        <td>
            <asp:Label ID="LabelDataFim" runat="server" Text="DataFim"></asp:Label>
        </td>
        
        <td>
            <asp:Label ID="Label2DataFim" runat="server" Text=""></asp:Label>
        </td>
    </tr>

    <tr>
        <td>
            <asp:Label ID="LabelPreco" runat="server" Text="Preco"></asp:Label>
        </td>
        
        <td>
            <asp:Label ID="Label2Preco" runat="server" Text=""></asp:Label>
        </td>
    </tr>
    
    <tr>
        <td>
            <asp:Label ID="LabelDescricao" runat="server" Text="Descrição"></asp:Label>
        </td>
        
        <td>
            <asp:Label ID="Label2Descricao" runat="server"></asp:Label>
        </td>   
    </tr>


    <tr>
        <td>
            <asp:Label ID="LabelCategoria" runat="server" Text="Categoria"></asp:Label>
        </td>
        
        <td>
            <asp:Label ID="Label2Categoria" runat="server"></asp:Label>
        </td>   
    </tr>
    </table>
    
    
    <br />
    <br />
    <br />
    
    
    <% 
        if(Request.QueryString["eventID"] != null){ %>
        <table>  
        <tr>
            <td>
                <asp:Label ID="LabelPalco"  Font-Size="Medium" runat="server" Text="palco"></asp:Label>
            </td>
            <td>
                
            </td>
        </tr>
        
        <tr>
            <td colspan="2">
                <hr />
            </td>
        </tr>
    
    
        <tr>
            <td>
            </td>
            <td>
            <%
            int eventID = Convert.ToInt32(Request.QueryString["eventID"].ToString());
            ListaPalco e = new ListaPalco();

            ListaPalco listaPalco = e.getPalcosEvento(eventID);

            for (int i = 0; i < listaPalco.getListaPalco().Count; i++) { 
                %>
                
                
            <asp:HyperLink ID="HyperLink1" runat="server"></asp:HyperLink>
            <% HyperLink1.Text = listaPalco.getListaPalco()[i].getNomePalco(); %>
            <% HyperLink1.NavigateUrl = "showPalco.aspx?palcoID="+listaPalco.getListaPalco()[i].getIDPalco()+"";%>
            <br />
            <%}
            }
        %>

            </td>
        
        </tr>
    </table>
    
        <% if (Session["userID"] != null) { %>
            <asp:HyperLink ID="HyperLink3" runat="server" Text = "Adicionar Palco ao Evento" NavigateUrl="~/addPalcoEvento.aspx"></asp:HyperLink><br />
            <asp:HyperLink ID="HyperLink4" runat="server" Text = "Remover Palco do Evento" NavigateUrl="~/removePalcoEvento.aspx"></asp:HyperLink>
       <%} %>
    
    <br />
    <br />
    <br />
    
    <% if(Request.QueryString["eventID"] != null){ %>
    <table>  
        <tr>
            <td>
                <asp:Label ID="LabelArtistasEvento"  Font-Size="Medium" runat="server" Text="artistas"></asp:Label>
           </td>
            <td>
                
            </td>
        </tr>
        
        <tr>
            <td colspan="2">
                <hr />
            </td>
        </tr>
        
        <tr>
        <td>
        
        </td>
        <td>
        
        <%
            int eventID = Convert.ToInt32(Request.QueryString["eventID"].ToString());
            ListaArtista e = new ListaArtista();

            ListaArtista listaArtista = e.getArtistasEvento(eventID);

            for (int i = 0; i < listaArtista.getListaArtistas().Count; i++) { 
                %>
                
                
            <asp:HyperLink ID="HyperLink2" runat="server"></asp:HyperLink>
            <% HyperLink2.Text = listaArtista.getListaArtistas()[i].getNomeArtista(); %>
            <% HyperLink2.NavigateUrl = "viewArtista.aspx?artistID="+listaArtista.getListaArtistas()[i].getIDArtista()+"";%>
            <br />
            <%}                 
            }
        %>
        </td>
        
        </tr>


    </table>
    
    <% if (Session["userID"] != null) { %>
            <asp:HyperLink runat="server" Text = "Adicionar Artista ao Evento" NavigateUrl="~/addArtistaEvento.aspx"></asp:HyperLink><br />
            <asp:HyperLink ID="HyperLink5" runat="server" Text = "Remover Artista do Evento" NavigateUrl="~/removeArtistaEvento.aspx"></asp:HyperLink>
       <%} %>
    
    <br />
    <br />
    <br />
    
    <table>
    <% if (Session["userID"] != null)
       { %>
    <tr>
        <td  colspan="2">
            <asp:Label ID="LabelComentar" runat="server" Text="Escrever Comentário"></asp:Label>
        </td>
    </tr>
    
    <tr >
        <td colspan="2">
            <asp:TextBox ID="TextBoxComentario" runat="server" TextMode="MultiLine"></asp:TextBox>
        </td>
  
    </tr>
    

    <tr>
        <td>
           
        </td>
        
        <td>
            <asp:Button ID="ButtonComentar" runat="server" Text="Comentar"  OnClick="comentarEvento"/>
        </td>   
    </tr>
       
        
        
        <tr>
        <td>
           
        </td>
        
        <td>
        
            <asp:Button ID="ButtonPresenca" runat="server" Text=""  OnClick="changePresenca"/>
        </td>   
    </tr>
    

    
    <table>
    
    <%    
        int eventID;
        if (Request.QueryString["eventID"] != null)
        {
            eventID = Convert.ToInt32(Request.QueryString["eventID"].ToString());
            ListaComentario bLayer = new ListaComentario();
            ListaComentario listaC = new ListaComentario(bLayer.getListaComentarios(eventID, -10));

            for (int i = 0; i < listaC.getListaComentarios().Count; i++)
            {
                Comentario comment = listaC.getListaComentarios()[i];
                
                 %>
                <tr>
                <td>
                <asp:HyperLink ID="HyperLink" runat="server"></asp:HyperLink>
                    <% HyperLink.Text = comment.getComentarioUsername(); %>
                    @   <asp:Label ID="LabelData" runat="server" Text=""></asp:Label>
                    <% LabelData.Text = comment.getComentarioData().ToString();
                    
                %>    
                </td>                
                <td>
                    <% if (Convert.ToInt32(Session["userStatus"].ToString()) > 1)
                       {   %>
                    <asp:LinkButton ID="LinkButtonCensurar"  runat="server"  OnClick="censurar"  >Censurar</asp:LinkButton>
                    <% 
                    
                        //LinkButtonCensurar.CommandArgument = Convert.ToString(comment.getComentarioID());
                        LinkButtonCensurar.CommandArgument = "Cenassa :D";
                    } %>
                </td>
                
                </tr>
                <tr>
                <td colspan="2">
                    <asp:Label ID="LabelComentario" runat="server" Text=""></asp:Label>
                    <% if (comment.getComentarioStatus() != 0)
                       {
                           LabelComentario.Text = comment.getComentarioText();
                       }
                       else
                       {
                           LabelComentario.Text = "Comentário Censurado";
                           
                       }%>
                </td>
                </tr>
           
        <% }%>
           
           
        
    
    <% }

       }%>
       
       
               <tr>
            <td>    
                <br /><br /><br />
                <% if(Session["userID"] != null){ %>
                    Mais opções:
                
                
                
                <% if(Convert.ToInt32(Session["userStatus"].ToString()) >=1) { %>
                    
                    <br />
                    <asp:HyperLink ID="HyperLinkEditar" runat="server" NavigateUrl="~/editEvento.aspx"></asp:HyperLink>
                    <br />
                    <asp:LinkButton ID="LinkButtonDenunciar" runat="server" OnClick="setDenunciado"></asp:LinkButton>                    
                    <% } %>
                    
                   <% if(Convert.ToInt32(Session["userStatus"].ToString()) >=2) { %>

                    <br />
                    <asp:LinkButton ID="LinkButtonRemover" runat="server"  OnClick="setRemovido"></asp:LinkButton>
                   <% } %>
                    
                 <% } %>
            </td>
            <td></td>
        </tr>
    
    </table>
</table>

</asp:Content>
